package com.kaishengit.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.kaishengit.dao.TaskTypeDao;
import com.kaishengit.pojo.TaskType;
@Transactional
public class TaskTypeService {
	
 private TaskTypeDao taskTypeDao;
	
	
	
	
	
	public TaskTypeDao getTaskTypeDao() {
		return taskTypeDao;
	}
	public void setTaskTypeDao(TaskTypeDao taskTypeDao) {
		this.taskTypeDao = taskTypeDao;
	}


	public List<TaskType> findall() {
		String hql = "select h from TaskType as h where h.enable = ?";
		return taskTypeDao.find(hql, true);
		//return taskTypeDao.findBy("enables", true);
	}

	public TaskType findByType(String type) {
		
		return taskTypeDao.findByUnique("type", type);
	}




	public void save(TaskType t) {
		taskTypeDao.save(t);
		
	}




	public TaskType findByTypeid(String typeid) {
		return taskTypeDao.get(typeid);
	}

}
